package com.kuaimacode.kframework.api.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kuaimacode.kframework.mybatis.mapper.user.UserCertifacateMapper;
import com.kuaimacode.kframework.mybatis.models.user.UserCertifacate;
import org.springframework.stereotype.Service;

/**
 * @author qinyong
 * @Title:
 * @Package com.kuaimacode.kframework.api.service
 * @Description: created by IntelliJ IDEA
 * @date 2019-03-10 21:42
 */
@Service
public class UserCertifacateService extends ServiceImpl<UserCertifacateMapper, UserCertifacate> {

    /**
     * 根据userid查询实名信息
     * @param userId
     * @return
     */
    public UserCertifacate selectByUserId(Long userId) {
        QueryWrapper<UserCertifacate> qryWrapper = new QueryWrapper<>();
        qryWrapper.eq("user_id", userId);
        return baseMapper.selectOne(qryWrapper);
    }
}
